package com.sangengblog.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sangengblog.domain.entity.Menu;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 菜单权限表(Menu)表数据库访问层
 *
 * @author makejava
 * @since 2024-04-10 21:53:38
 */
public interface MenuMapper extends BaseMapper<Menu> {
    List<String> selectPermsByUserId(Long userId);

    List<Menu> selectAllRouterMenu();

    List<Menu> selectRouterMenuTreeByUserId(Long userId);
//
//    @Select(value = "select role_id from sys_user_role where user_id=#{id}")
//    Long selectRoleIdByUserId(Long id);

    @Select(value = "select menu_id from sys_role_menu where role_id=#{roleId}")
    List<Long> selectMenuIdsByRoleId(Long roleId);
}
